let URL = "http://localhost:8080";
let projectName = "/restaurant07front-1029";

function myFrontAjax(url, data) {

    let result = null;
    $.ajax({
        url: URL + url,//對應后台servlet的注解地址
        data: {},//传递给后台的数据
        type: "get",//和后台方法一直
        async: false,
        xhrFields: {
            withCredentials: true //允许跨域带Cookie
        },
        dataType: 'json',//后台传递给前台的数据格式
        success: function (data) {//data后台传递给前台的数据
            result = data;
        }
    });
    return result;
}